<%@ taglib prefix="c" 
           uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>          
<%@ page isELIgnored="false" %>
<%@ page errorPage="common/error.jsp" %>
<%@ include file = "common/header.jsp" %>
<html>
<body>
	<form method="POST">
	<h1><c:choose>
					<c:when test="${not empty book.bookId }">
						Updating Book ${book.title}
					</c:when>
					<c:otherwise>
						Adding new book
					</c:otherwise>
		</c:choose>
		</h1>
		<label for="book_title">Title: </label>
		<input id = "book_title" type="text" name="book_title" value="${book.title}"> <br /><br /> 
		<label for="book_author">Author: </label>
		 <input id = "book_author" type="text" name="book_author" value="${book.author}"/> <br /> <br /> 
		<label for="pub_date"> Publication date:</label>
		<input id = "pub_date" type="datetime-local" name="pub_date" value="${book.publicationDate}" /><br /> <br />  
		<label for="book_price"> Price:</label>
		<input type="text" id = "book_price" name="book_price" value="${book.price}" /><br /> <br /> 
		<label for="book_quantity">Quantity:</label>
		<input type="text" id = "book_quantity" name="book_quantity" value="${book.quantity}" /><br /> <br /> 
		<c:if test="${not empty book.bookId}">
				<input type="hidden" name="id" value="${book.bookId}" />
			</c:if>
		<input type="submit" value="Submit" /><br /> <br /> 
	</form>
	<%@ include file = "common/footer.jsp" %>
</body>
</html>